package com.wenjing.xiaoyun.chat.agent;


import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * @author jiangshizhang
 * @version 1.0
 * @description: 小云助手
 * @date 2025/5/26 15:55
 */
@AiService(
        wiringMode = EXPLICIT,
        chatMemoryProvider = "xiaoYunChatMemoryProvider",
        streamingChatModel = "qwenStreamingChatModel"
        // tools = {""}工具
        // contentRetriever = "contentRetrieverXiaoyun" //配置向量存储
)
public interface XiaoYunChatAssistant {
    /**
     * 聊天调用方法
     *
     * @param memoryId    记录聊天上下文
     * @param userMessage 用户信息
     * @return 返回信息
     */
    @SystemMessage(fromResource = "xiaoyun-prompt-template.txt")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage);
}
